home *** CD-ROM | disk | FTP | other *** search
- /**
- ** (sjk)++ These routines are a bunch of fake outs for various eunchs
- ** routines that are not present on the Atari ST
- **/
-
- #include <errno.h>
- #include <fcntl.h>
- #include <sys/time.h>
- #include <sys/resource.h>
- #include "r-res.h"
-
-
- /**
- ** (sjk)++ Set up a 128K initial stack for Bash to nosh on.
- **/
-
- extern long _initial_stack;
- long _initial_stack = 128 * 1024L;
-
- static char default_host[] = " Atari-ST ";
-
- int getdtablesize()
- {
- return(__NHANDLES);
- }
-
- char *gethostname()
- {
- char *ptr;
- ptr = (char *)getenv("HOST");
- if ( ptr == (char *)0 ) return(default_host);
- else return(ptr);
- }
-
- int sigblock(x)
- int x;
- {
- return(1);
- }
-
- int sigmask()
- {
- return(0);
- }
-
- int sigsetmask(x)
- int x;
- {
- return(0);
- }
-
-
- /**
- ** (sjk)++ Some very weak inplimentation of the ulimit functions.
- **/
-
- int
- getrlimit(int resource, struct rlimit *rlp)
- {
- if(!rlp) {
- errno = EFAULT;
- return -1;
- }
- switch(resource) {
- case RLIMIT_CPU :
- case RLIMIT_FSIZE : {
- rlp->rlim_cur = rlp->rlim_max = RLIM_INFINITY;
- break;
- }
- case RLIMIT_DATA :
- case RLIMIT_STACK :
- case RLIMIT_RSS : {
- rlp->rlim_cur = rlp->rlim_max = (int) rlp - sbrk(0);
- break;
- }
- case RLIMIT_CORE : {
- rlp->rlim_cur = rlp->rlim_max = 0;
- break;
- }
- }
- return 0;
- }
-
- int
- setrlimit(int resource, struct rlimit *rlp)
- {
- if(!rlp) {
- errno = EFAULT;
- return -1;
- }
- /* setting resource limits is not implemented */
- return 0;
- }
-